3.426 \(\int \sec (c+d x) (a+b \tan ^2(c+d x)) \, dx\)

Optimal. Leaf size=42 \[ \frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \tan (c+d x) \sec (c+d x)}{2 d} \]

[Out]

1/2*(2*a-b)*arctanh(sin(d*x+c))/d+1/2*b*sec(d*x+c)*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {3676, 385, 206} \[ \frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \tan (c+d x) \sec (c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

((2*a - b)*ArcTanh[Sin[c + d*x]])/(2*d) + (b*Sec[c + d*x]*Tan[c + d*x])/(2*d)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 385

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> -Simp[((b*c - a*d)*x*(a + b*x^n)^(p +
 1))/(a*b*n*(p + 1)), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /
; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 3676

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec (c+d x) \left (a+b \tan ^2(c+d x)\right ) \, dx &=\frac {\operatorname {Subst}\left (\int \frac {a-(a-b) x^2}{\left (1-x^2\right )^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \sec (c+d x) \tan (c+d x)}{2 d}+\frac {(2 a-b) \operatorname {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{2 d}\\ &=\frac {(2 a-b) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \sec (c+d x) \tan (c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.03, size = 48, normalized size = 1.14 \[ \frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {b \tan (c+d x) \sec (c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]*(a + b*Tan[c + d*x]^2),x]

[Out]

(a*ArcTanh[Sin[c + d*x]])/d - (b*ArcTanh[Sin[c + d*x]])/(2*d) + (b*Sec[c + d*x]*Tan[c + d*x])/(2*d)

________________________________________________________________________________________

fricas [A]  time = 0.52, size = 76, normalized size = 1.81 \[ \frac {{\left (2 \, a - b\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - b\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, b \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="fricas")

[Out]

1/4*((2*a - b)*cos(d*x + c)^2*log(sin(d*x + c) + 1) - (2*a - b)*cos(d*x + c)^2*log(-sin(d*x + c) + 1) + 2*b*si
n(d*x + c))/(d*cos(d*x + c)^2)

________________________________________________________________________________________

giac [A]  time = 1.39, size = 64, normalized size = 1.52 \[ \frac {{\left (2 \, a - b\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - {\left (2 \, a - b\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, b \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="giac")

[Out]

1/4*((2*a - b)*log(abs(sin(d*x + c) + 1)) - (2*a - b)*log(abs(sin(d*x + c) - 1)) - 2*b*sin(d*x + c)/(sin(d*x +
 c)^2 - 1))/d

________________________________________________________________________________________

maple [A]  time = 0.29, size = 75, normalized size = 1.79 \[ \frac {b \left (\sin ^{3}\left (d x +c \right )\right )}{2 d \cos \left (d x +c \right )^{2}}+\frac {b \sin \left (d x +c \right )}{2 d}-\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2 d}+\frac {a \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(a+b*tan(d*x+c)^2),x)

[Out]

1/2/d*b*sin(d*x+c)^3/cos(d*x+c)^2+1/2*b*sin(d*x+c)/d-1/2/d*b*ln(sec(d*x+c)+tan(d*x+c))+1/d*a*ln(sec(d*x+c)+tan
(d*x+c))

________________________________________________________________________________________

maxima [A]  time = 1.10, size = 62, normalized size = 1.48 \[ \frac {{\left (2 \, a - b\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a - b\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, b \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)^2),x, algorithm="maxima")

[Out]

1/4*((2*a - b)*log(sin(d*x + c) + 1) - (2*a - b)*log(sin(d*x + c) - 1) - 2*b*sin(d*x + c)/(sin(d*x + c)^2 - 1)
)/d

________________________________________________________________________________________

mupad [B]  time = 12.29, size = 79, normalized size = 1.88 \[ \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (2\,a-b\right )}{d}+\frac {b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x)^2)/cos(c + d*x),x)

[Out]

(atanh(tan(c/2 + (d*x)/2))*(2*a - b))/d + (b*tan(c/2 + (d*x)/2) + b*tan(c/2 + (d*x)/2)^3)/(d*(tan(c/2 + (d*x)/
2)^4 - 2*tan(c/2 + (d*x)/2)^2 + 1))

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right ) \sec {\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(a+b*tan(d*x+c)**2),x)

[Out]

Integral((a + b*tan(c + d*x)**2)*sec(c + d*x), x)

________________________________________________________________________________________